# Copyright 2021 Alibaba Group Holding Limited. All Rights Reserved.

# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at

# http://www.apache.org/licenses/LICENSE-2.0

# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

include (CMakeFindDependencyMacro)

list (APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR})

if (NOT Protobuf_FOUND)
  find_dependency (Protobuf 3.10.0 REQUIRED QUIET)
endif()

if (NOT gRPC_FOUND)
  find_dependency (gRPC 1.26.0 REQUIRED QUIET)
endif ()

if (NOT CppKafka_FOUND)
  find_dependency (CppKafka 0.3.1 REQUIRED QUIET)
endif ()

if (NOT Flatbuffers_FOUND)
  find_dependency (Flatbuffers 1.12.0 REQUIRED QUIET)
endif ()

if (NOT Boost_thread_FOUND)
  find_dependency (Boost COMPONENTS thread QUIET)
endif ()

if (NOT Boost_program_options_FOUND)
  find_dependency (Boost COMPONENTS program_options QUIET)
endif ()

if (NOT Boost_filesystem_FOUND)
  find_dependency (Boost COMPONENTS filesystem QUIET)
endif ()

if (NOT TARGET yaml-cpp)
  find_dependency (yaml-cpp QUIET)
endif ()

if (NOT TARGET glog::glog)
  find_dependency (glog::glog QUIET)
endif ()

if (NOT TARGET DataLoader::dataloader)
  include ("${CMAKE_CURRENT_LIST_DIR}/DataLoaderTargets.cmake")
endif ()